package yl.hs.bmipfull.controllers.chart;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import yl.hs.bmipfull.controllers.ControllerBase;
import yl.hs.bmipfull.service.chart.ISaleChartService;
import yl.hs.bmipfull.viewmodels.PageQuery;
import yl.hs.bmipfull.viewmodels.WebResult;

/**
 * @author 谢东
 * @apiNote 图表中心-销售
 * @since 2022-03-16 8:45 创建
 */
@Api(value = "图表中心-销售web接口",tags = "图表中心-销售")
@RestController
@RequestMapping(value = "/api/SaleChart")
public class SaleChartController  extends ControllerBase {

    @Autowired
    ISaleChartService saleChartService;

    @ApiOperation(value = "未完成的订单-个人", notes = "未完成的订单-个人")
    @RequestMapping(value = "/getUntreatedOrder",method = RequestMethod.GET)
    public WebResult getUntreatedOrder(){
        return  success("查询成功",saleChartService.getUntreatedOrder(2));
    }

    @ApiOperation(value = "预警中的合同数量", notes = "未完成的订单-个人")
    @RequestMapping(value = "/earlyWarningContract",method = RequestMethod.GET)
    public WebResult earlyWarningContract(){
        try{
            var result=  saleChartService.getEarlyWarningContract();
            return success("",result);
        }
        catch (Exception ee){
            return error(ee);
        }
    }
}
